﻿using STHPMS1.ICore.I_Entity;
using STHPMS1.ICore.I_Entity.Stmpms1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

namespace STHPMS1.ICore.I_DAL.Repository
{
    public interface IS_InspeaccseRepository : IDal
    {
        bool Exists(string unit, string inspecid, string tableName, string svydate);
        /// <summary>
        /// 返回当前线路评定数据的最新导入时间，最小桩号和最大桩号
        /// </summary>
        /// <param name="rdid"></param>
        /// <param name="inspecid"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        DataTable GetInspeaccseData(string rdid, string inspecid, int dir, string tableName);
        /// <summary>
        /// 返回当前评定名称下今年的路线编号
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="inspecid"></param>
        /// <returns></returns>
        DataTable GetRdway(string tableName, string inspecid);
        /// <summary>
        /// 修改评定表的列
        /// </summary>
        /// <param name="inspecId">评定ID</param>
        /// <param name="typeColumn">评定表列名</param>
        /// <returns></returns>
        bool UpdateStatus(string inspecId, string typeColumn);

        /// <summary>
        /// 获取一个路线下每年的检测评定ID
        /// 如果一个路线每年有多个检测数据的话只取最新的检测评定数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="rdwaryId"></param>
        /// <returns></returns>
        IEnumerable<T> GetInspeaccsePerYear<T>(string rdwaryId)
            where T : class, IS_Inspeaccse;

      /// <summary>
        /// 删除检查数据的重复单元
      /// </summary>
      /// <param name="tableName">表名</param>
      /// <param name="olds">重复的单元</param>
      /// <param name="inspecid">评定名称</param>
      /// <returns></returns>
        void UpdateUnit(string tableName, List<DataRow> olds, string inspecid);
    }
}
